<?php
/*
Primary Author: Alex Arey
Secondary: Derek Shue
Documentation: Cheng Yi
Updated: 12/10/2011
Module Description: The Willing Positions module adds/finds/updates/deletes Willing Positions from the database,
where Willing Positions are those Internship Positions that a student indicates interest in.
*/
class Application_Model_DbTable_WillingPositions extends Zend_Db_Table_Abstract
{

    protected $_name = 'WILLINGPOSITIONS';

public function getWillingPositions($where)
    {
        $rows = $this->fetchAll($where);
        if (!$rows) {
            throw new Exception("Could not find row where $where");
        }
        return $rows->toArray();
    }


    public function addWillingPosition($appid,$posid,$rank,$qualifications)
    {
        $data = array(
      	'APPID'=> $appid,
		'POSID'=> $posid,
		'RANK'=> $rank,
		'QUALIFICATIONS'=> $qualifications,
        );
        $this->insert($data);
    }

    public function updateWillingPosition($appid,$posid,$rank,$qualifications
)
    {
        $data = array(
            'APPID'=> $appid,
'POSID'=> $posid,
'RANK'=> $rank,
'QUALIFICATIONS'=> $qualifications,

        );
        $this->update($data, 'APPID = '. (int)$appid);
    }

    public function deleteWillingPosition($appid)
    {
        $this->delete('APPID =' . (int)$appid);
    }



}

















































































































































